import java.util.*;

public class QueueImpl<T> implements Queue<T> {
	
	private List<T> myObjects;
	
	public QueueImpl(boolean withDuplicates){
		if(withDuplicates!=false)
			myObjects = new ArrayList<T>();
		else
			myObjects =  new OrderedSetImpl<T>();
	}
	
	public boolean add(T o){
		return myObjects.add(o);
	}
	
	public T remove(){
		if(myObjects.size()==0) 
			return null;
		return myObjects.remove(0);
	}
	
	public T front(){
		if(myObjects.size()==0) 
			return null;
		return myObjects.get(0);
	}
	
	public boolean isEmpty(){
		return myObjects.isEmpty();
	}
	
	public int size(){
		return myObjects.size();
	}

}
